// LucasLehmer, Performs the Lucas Lehmer algorithm
// Copyright (C) 2014  David McCloskey
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

#include "common.h"
#include "algorithms/basic_mersenne/basic_mersenne.h"

namespace algorithms
{
    
	void forward_fft(uint32_t start_coeff, uint32_t end_coeff, const fft_config &config, uint64_t ** limbs)
	{
        for (uint32_t base_coeff = start_coeff; base_coeff < end_coeff; ++base_coeff)
		{
            uint32_t block = (base_coeff & config.blocks_mask) >> config.half_coeffs_bits;
            uint32_t block_index = base_coeff & config.coeffs_mask;
            
            uint32_t first_coeff = block * config.coeffs + block_index;
            uint32_t second_coeff = first_coeff + config.half_coeffs;
            
			uint32_t twiddle = config.twiddle_base * block_index;

			printf("  base_coeff: %d, block: %d, 1st coeff: %d, 2nd coeff: %d, twiddle: %d\n", base_coeff, block, first_coeff, second_coeff, twiddle);
		}
	}

};
